#!/bin/sh

DEST_ROOT=/data

#while [ 1 ]
#do
  DEST_DIR=$DEST_ROOT/`date +%y%m%d`/`date +%H`
  STAMP=`date +%y%m%d_%H%M%S`

  if [ ! -d $DEST_DIR ]
  then
      mkdir -p $DEST_DIR
  fi

#  ./dackel -t6000000 -u10us -z3 -o$DEST_DIR/$STAMP.dkl -l$DEST_DIR/$STAMP.log $*
  ~/alex/dackel/dackel -t100000000 -r 4 -z3 -o$DEST_DIR/$STAMP.dkl -l$DEST_DIR/$STAMP.log $*

  if [ $? -ne 0 ]
  then
#			sleep 5;
#			./load_module
#			sleep 5;
#			./load_module
#			sleep 5;
			exit
  fi

#done